package com.kaifamiao.io.d0923;

public class DBUtilDemo {

    public static void main(String[] args) {
        DBUtil dbUtil = new DBUtil();
        String sql = "select * from dept where deptno = 20";
        Dept dept = dbUtil.queryOne(sql, Dept.class);
        System.out.println(dept);
    }
}


class Dept{
    private int deptno;

    private String dname;

    private String loc;

    public int getDeptno() {
        return deptno;
    }

    public void setDeptno(int deptno) {
        this.deptno = deptno;
    }

    public String getDname() {
        return dname;
    }

    public void setDname(String dname) {
        this.dname = dname;
    }

    public String getLoc() {
        return loc;
    }

    public void setLoc(String loc) {
        this.loc = loc;
    }


    @Override
    public String toString() {
        return "Dept{" +
                "deptno=" + deptno +
                ", dname='" + dname + '\'' +
                ", loc='" + loc + '\'' +
                '}';
    }
}
